package cn.team11.smarteye.widget;

import android.content.Context;
import android.support.v4.content.ContextCompat;

import cn.team11.sds.dayi.R;
import com.prolificinteractive.materialcalendarview.CalendarDay;
import com.prolificinteractive.materialcalendarview.DayViewDecorator;
import com.prolificinteractive.materialcalendarview.DayViewFacade;
import com.prolificinteractive.materialcalendarview.spans.DotSpan;

import java.util.HashSet;
import java.util.List;

/**
 * Created by Yang on 2017/11/18.
 */

public class EventDecorator implements DayViewDecorator {

    private Context mContext;
    private HashSet<CalendarDay> dates;

    public EventDecorator(Context context, HashSet<CalendarDay> dates) {
        this.dates = dates;
        this.mContext = context;
    }

    @Override
    public boolean shouldDecorate(CalendarDay day) {
        return dates.contains(day);
    }

    @Override
    public void decorate(DayViewFacade view) {
        view.addSpan(new DotSpan(5, ContextCompat.getColor(mContext, R.color.color_main_green)));
    }
}
